-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Serializer] Clarifies 'csv_headers' option #14609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
components/serializer.rst
Outdated
@@ -897,7 +897,7 @@ Option Description De | |||
``csv_escape_char`` Sets the escape character (at most one character) | |||
``csv_key_separator`` Sets the separator for array's keys during its ``.`` | |||
flattening | |||
``csv_headers`` Sets the headers for the data ``[]``, inferred from input data's keys | |||
``csv_headers`` Sets the order of the header and data columns ``[]``, inferred from input data's keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand the problem you want to fix ... but I'm not sure the fix is correct.
If I read "sets the headers for the data", I think about this:
'csv_headers' => ['Header 1 Name', 'Header 2 Name', '...']
But if I read "sets the order of the header and data", I understand it like this:
# header name => header position
'csv_headers' => ['Header 1 Name' => 2, 'Header 2 Name' => 1, '...']
Maybe adding a small example could help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comments. I added an example, hopefully that will make it more clear.
Thank you @lajosthiel and congrats on your first Symfony Docs contribution! |
No description provided.